<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        console.log("请求A的数据........");
        //以下列这种回调函数嵌套回调函数来实现异步的称作为 回调地狱
            //— 回调地狱耦合度高，不方便维护和阅读
        setTimeout(() => {
            console.log("获取A的数据成功");
            console.log("请求B的数据........");
            setTimeout(() => {
                console.log("获取B的数据成功");
                console.log("请求C的数据........");
                setTimeout(() => {
                    console.log("获取C的数据成功");
                }, 3000)
            }, 3000)
        }, 3000)

        console.log("endCode");
    </script>
</body>

</html>